<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>

<!-- 导入jquery核心类库 -->
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/jquery-1.8.3.js"></script>
<!-- 导入easyui类库 -->
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/themes/icon.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/js/easyui/ext/portal.css">
<link rel="stylesheet" type="text/css"
	href="${pageContext.request.contextPath }/css/default.css">	
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/jquery.easyui.min.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.portal.js"></script>
<script type="text/javascript"
	src="${pageContext.request.contextPath }/js/easyui/ext/jquery.cookie.js"></script>
<script
	src="${pageContext.request.contextPath }/js/easyui/locale/easyui-lang-zh_CN.js"
	type="text/javascript"></script>
		
<script type="text/javascript">

	$(function(){
		$("body").css({visibility:"visible"});
		//提交表单
		
		 $('#return').click(function(){
			 
				location.href="${pageContext.request.contextPath}/page.rdcustomer.ashx"

		 });

		 
		//定义列
		var columns = [ [ 
		{
		field : 'category',
		title : '品类',
		width : 120,	
	},{
		field : 'typename',
		title : '项目',
		width : 120,	
	}, {
		field : 'shuzhi',
		title : '数值',
		width : 120,
	}, {
		field : 'uploaddatetime',
		title : '上传时间',
		width : 120,
		formatter:formatterDate
	} ] ];
		
		
		var userid = $("#input_userid").val();
	


		// 收派标准数据表格
		$('#grid').datagrid( {
			iconCls : 'icon-forward',
			fit : true,
			border : false,
			rownumbers : true,
			singleSelect:true,
			striped : true,
			url : "${pageContext.request.contextPath}/page.scandatalist.ashx",
			idField : 'id',
			columns : columns,
			pageList: [10,30,50,100],
			pagination:true,
			 view:myview,
			emptyMsg:"<font size=3>暂无记录</font>", 
			queryParams: {
				userid:userid
			}
		});

	  
		
	});
	
	var myview = $.extend({},$.fn.datagrid.defaults.view,{
		onAfterRender:function(target){
			$.fn.datagrid.defaults.view.onAfterRender.call(this,target);
			var opts = $(target).datagrid('options');
			var vc = $(target).datagrid('getPanel').children('div.datagrid-view');
			vc.children('div.datagrid-empty').remove();
			if (!$(target).datagrid('getRows').length){
				var d = $('<div class="datagrid-empty"></div>').html(opts.emptyMsg || 'no records').appendTo(vc);
				d.css({
					position:'relative',
					left:0,
					top:50,
					width:'100%',
					textAlign:'center'
				});
			}
		}
	});
	
	
	$(document).ready(function(){
		$("#addTime").html(formatterDate($("#input_addTime").val()));
		$("#sex").html(formatterSex($("#input_sex").val()));
		
	}); 
	

	
	function formatterSex(value){
		if(value==1){
			return "男";
		}else if(value==0){
			return "女";
		}
	}
	
	
	
	function formatterDate(value){
		if(value==''||null==value){
			return '';
		}
		var now = new Date(parseInt(value) * 1000);  
		var year=now.getYear()+1900; 
		var month=now.getMonth()+1; 
		var date=now.getDate(); 
		var hour=now.getHours(); 
		var minute=now.getMinutes();
		minute= (minute > 9) ? minute=minute : minute='0'+minute;
		return year+"-"+month+"-"+date+" "+hour+":"+minute; 
	}
	
	window.onload=function(){}
	
	function formatterDate(value){
		if(value==''||null==value){
			return '';
		}
		var now = new Date(parseInt(value) * 1000);  
		var year=now.getYear()+1900; 
		var month=now.getMonth()+1; 
		var date=now.getDate(); 
		var hour=now.getHours(); 
		var minute=now.getMinutes();
		minute= (minute > 9) ? minute=minute : minute='0'+minute;
		//var second=now.getSeconds(); 
		return year+"-"+month+"-"+date+" "+hour+":"+minute; 
	}
</script>	
</head>

<body class="easyui-layout" style="visibility:hidden;">
	<div region="north" style="height:31px;overflow:hidden;" split="false" border="false" >
		<div class="datagrid-toolbar">
			<a id="return" icon="icon-undo" href="#" class="easyui-linkbutton" plain="true" >返回</a>
			
		</div>
	</div>
    <div region="center" style="overflow:auto;padding:5px;" border="false">
      
         <table class="table-edit"  width="95%" align="center">
           		<tr class="title"><td colspan="6">基本信息</td></tr>
 

	           	<tr>
	           		
	           		<td>姓名:</td>
	           		<td >${customer.username}</td>
					<td>电话:</td>
					<td id="oOPNumber">${customer.phone}</td>
					
				</tr>  	 
				<tr>
					<td>公司:</td>
	           		<td >${customer.company}</td>
	           		<td>性别:</td>
					<td id="sex">${customer.sex}</td>
	           		<input type="hidden"  id = "input_sex" value="${customer.sex}"/>
	           		<input type="hidden"  id = "input_userid" value="${customer.id}"/>
	           		
				</tr> 
				
					<tr>
					
					
	           		<td>部门名称：</td>
					<td id="rState">${customer.departname}</td>
	           		
	           		<td>编号:</td>
	           		<td id="rSellTime">${customer.numberid}</td>
				</tr> 
				
				<tr>
					<td>邮箱:</td>
	           		<td >${customer.email}</td>
	           		
	           		
			
				<td>量体师 :</td>
	           		<td >${customer.managerName}</td>
	           		
	           		</tr>
					<tr>
	           		
	           		<td>E尺SN :</td>
	           		<td >${customer.rsn}</td>
					
					<td>E尺MAC:</td>
					<td id="rRukuTime">${customer.rmac}</td>
					
					
				</tr> <tr>
	           		<td>E卡尺SN :</td>
	           		<td >${customer.ersn}</td>
					
					<td>E卡尺MAC:</td>
					<td >${customer.ermac}</td>
					
					
				</tr> <tr>
	           		<td>E腰尺SN :</td>
	           		<td >${customer.ebsn}</td>
					
					<td>E腰尺MAC:</td>
					<td >${customer.ebmac}</td>
					
					
				</tr> <tr>
	           		<td>E角尺SN :</td>
	           		<td >${customer.easn}</td>
					
					<td>E角尺MAC:</td>
					<td >${customer.eamac}</td>
					
					
				</tr> <tr>
	           		<td>E秤SN :</td>
	           		<td >${customer.essn}</td>
					
					<td>E秤MAC:</td>
					<td >${customer.esmac}</td>
					
					
				</tr>  	<tr>  	
				
					<td>添加时间:</td>
	           		<td id="addTime">${customer.addtime}</td>
	           		<input type="hidden"  id = "input_addTime" value="${customer.addtime}"/>
					<td>备注:</td>
	           		<td >${customer.remark}</td>
					
				</tr>  	
			</table>
			
	

			
			 <table class="table-edit"  width="95%" align="center">
           		<tr class="title"><td colspan="6">测量 参数</td></tr>
			</table>
			
			<div style="height:50%;width:95%; margin:0 auto;" >
				<table  id="grid"></table>
			</div>
			
			
			
          
	</div>
</body>
</html>